/*************************************************************************
> File Name: factorial.c
> Author: icebear
> Mail: 3322366195@qq.com
> Created Time: 2023-07-31 19:56:02
> Description: 20的阶乘
************************************************************************/

#include <stdio.h>
long factorial(int n);
int main(int argc, char const *argv[])
{
    printf("%ld\n", factorial(20));
    return 0;
}

long factorial(int n) // 数据过大 用long存储
{
    if (n == 1)
    {
        return 1;
    }
    return n * factorial(n - 1);
}